/*  -*- mode: c++; coding: utf-8; c-file-style: "stroustrup"; -*-

    Copyright 2008 Asier Aguirre <asier.aguirre@gmail.com>
    This file is part of Intromit.

    Intromit is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Intromit is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Intromit.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MARSHALLING_HH
#define MARSHALLING_HH
//! \addtogroup util
//@{

// DECLARATIONS
#define MARSHALL_MID_STACK      4 // words
#define MARSHALL_MAX_STACK   2048 // words
#define MARSHALL_HIGHT_LEVEL      // use hight level implementation, not asm one

// CLASSES
class marshalling
{

    // PRIVATE FUNCTIONS

public:

    static void func_call_ret_void(int *esp, void *func_ptr, int n_esp=MARSHALL_MAX_STACK);
    static int func_call_ret_int(int *esp, void *func_ptr, int n_esp=MARSHALL_MAX_STACK);
    static double func_call_ret_double(int *esp, void *func_ptr, int n_esp=MARSHALL_MAX_STACK);
    static long long func_call_ret_long_long(int *esp, void *func_ptr, int n_esp=MARSHALL_MAX_STACK);
};

//@}
#endif

/* Offline metadata attributes:

   @metadata_attrs(
	marshalling,
	marshall_max_stack,
	marshall_mid_stack:
					~select
   )
*/
